//
//  FourShoppingTableViewCell.m
//  OpenYooxi_IOS
//
//  Created by YeahYes on 15/3/17.
//  Copyright (c) 2015年 com.ivyvi.ee. All rights reserved.
//

#import "FourShoppingTableViewCell.h"
#import "UIView+UIViewController.h"
#import "ShangPinXiangQing_ViewController.h"

@implementation FourShoppingTableViewCell{

    UITapGestureRecognizer *tap1;

}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.contentView.layer.borderColor = UIColorFromRGB(0xE5E5E5).CGColor;
    self.contentView.layer.borderWidth = 1;
    
    _xian1.backgroundColor =UIColorFromRGB(0xE5E5E5);
    _xian2.backgroundColor =UIColorFromRGB(0xE5E5E5);
    
    
    /**给字体加颜色的代码
     */
    NSMutableAttributedString *attrstring1 = [[NSMutableAttributedString alloc] initWithString:_shopmoney1.text];
    NSString *s1 = [_shopmoney1.text substringFromIndex:4];
    [attrstring1 addAttribute:NSForegroundColorAttributeName
                       value:UIColorFromRGB(0xF89D5E)
                       range:[_shopmoney1.text rangeOfString:s1]];
    _shopmoney1.attributedText = attrstring1;
    
    
    NSMutableAttributedString *attrstring2 = [[NSMutableAttributedString alloc] initWithString:_shopmoney2.text];
    NSString *s2 = [_shopmoney2.text substringFromIndex:0];
    [attrstring2 addAttribute:NSForegroundColorAttributeName
                       value:UIColorFromRGB(0xFF7332)
                       range:[_shopmoney2.text rangeOfString:s2]];
    _shopmoney2.attributedText = attrstring2;
    
    
    NSMutableAttributedString *attrstring3 = [[NSMutableAttributedString alloc] initWithString:_shopmoney3.text];
    NSString *s3 = [_shopmoney3.text substringFromIndex:4];
    [attrstring3 addAttribute:NSForegroundColorAttributeName
                        value:UIColorFromRGB(0xF89D5E)
                        range:[_shopmoney3.text rangeOfString:s3]];
    _shopmoney3.attributedText = attrstring3;
    
    
    NSMutableAttributedString *attrstring4 = [[NSMutableAttributedString alloc] initWithString:_shopmoney4.text];
    NSString *s4 = [_shopmoney4.text substringFromIndex:0];
    [attrstring4 addAttribute:NSForegroundColorAttributeName
                        value:UIColorFromRGB(0xFF7332)
                        range:[_shopmoney4.text rangeOfString:s4]];
    _shopmoney4.attributedText = attrstring4;
    
    
    
    /**我的订单手势添加*/
    tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap1:)];;
    [_fifirstview addGestureRecognizer:tap1];
    
}


#pragma mark - 手势的添加点击事件
- (void)tap1:(UITapGestureRecognizer *)tap {
    
    if(tap.state == UIGestureRecognizerStateEnded) {
   
        ShangPinXiangQing_ViewController *modalCtrl = [[ShangPinXiangQing_ViewController alloc] initWithNibName:@"ShangPinXiangQing_ViewController" bundle:[NSBundle mainBundle]];
        modalCtrl.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
        [self.viewController presentViewController:modalCtrl
                           animated:YES
                         completion:NULL];
    }
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
